package com.k2data.k2app.domain.po;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.k2data.k2app.constant.Constant;
import com.k2data.k2app.domain.vo.Device;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 任务和作业关联表
 */
@Data
@Table(name = "job_task")
public class JobTaskDO {

	@Id
	@GeneratedValue(generator = "JDBC")
	private Long id;

	/**
	 * 任务id
	 */
	private Long taskId;

	/**
	 * 作业id
	 */
	private Long jobId;

	/**
	 * 分析模型的id
	 */
	private Long projectId;

	private Integer status ;

	private Integer isDealKmx;

	private String message;

	private String taskName;

	private String taskType;

	/**
	 * 生效时间: where条件开始时间
	 */
	@JsonFormat(pattern = Constant.ISO_FORMAT)
	@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
	private LocalDateTime startTime;

	/**
	 * 失效时间: where条件结束时间
	 */
	@JsonFormat(pattern = Constant.ISO_FORMAT)
	@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
	private LocalDateTime endTime;

	/**
	 * 表关联:任务表
	 */
	@Transient
	TaskDO taskDO;
	@Transient
	private Long modelId;
}